package com.ylyr.routerfunction.domain;

import lombok.Data;
import org.hibernate.validator.constraints.Range;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import javax.validation.constraints.NotBlank;


/**
 * @Explain:
 * @Author: 30374
 * @Date: 2021/4/20
 */
@Document("users" )
@Data
public class User {
    @Id
    private String id;
    @NotBlank(message = "姓名不能为空")
    private String name;
    @Range(min = 1,max = 100,message = "年龄必须在1~100之间")
    private int age;
}
